package hong.jun.fallback;

import feign.hystrix.FallbackFactory;
import hong.jun.FeignClient.OrderFeignClient;
import hong.jun.domain.User;
import org.springframework.stereotype.Component;
import sun.misc.Contended;

@Component
public class OrderClientHystrixFallbackFactory implements FallbackFactory<OrderFeignClient> {
    @Override
    public OrderFeignClient create(Throwable throwable) {//返回接口
        return new  OrderFeignClient(){//new一个接口匿名内部实现类
            @Override
            public User touser(long id) {
                return new User(id,"去登录啊");
            }
        };
    }
}
